insert into [$BoxTable]
select $stage,[$indexColumn],
$MinMax
from [$Datatable]
group by [$indexColumn]